/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.chlitina.store.common.persistence.BaseEntity;

/**
 * 短信Entity
 * @author lvbo
 * @version 2013-06-21
 */
@Entity
@Table(name = "sms_send_queue")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SmsSendQueue extends BaseEntity {
	public static final int WAIT_STATUS = -1;//未采纳
	public static final int PROCEED_STATUS = 0;//  正在发送
	public static final int SUCCESS_STATUS = 1;// 发送成功
	public static final int FAIL_STATUS = 2;//  发送失败
	public static final int ERROR_CODE = -10;//  发送异常
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 短信编号
	private Date planSendTime; 		// 计划发送时间
	private String mobile; 		// 发送手机号码
	private String content; 		// 发送短信内容
	private int status; 		// 短信发送状态：	-1    待发送	0     正在发送	1     发送成功	2    发送失败
	private int error_code; 
		//case -1 "没有该用户账户";
		//case -2: "密钥不正确 ";
		//case -3: "短信数量不足";
		//case -11: "该用户被禁用";
		//case -14: "短信内容出现非法字符";
		//case -4: "手机号格式不正确";
		//case -41: "手机号码为空";
		//case -42: "短信内容为空";
		//case -10: "其他发送异常";
	public SmsSendQueue() {
		this.status = -1;
	}

	public SmsSendQueue(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_sms_smsSendQueue")
	//@SequenceGenerator(name = "seq_sms_smsSendQueue", sequenceName = "seq_sms_smsSendQueue")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="plan_send_time")
	public Date getPlanSendTime() {
		return planSendTime;
	}

	public void setPlanSendTime(Date planSendTime) {
		this.planSendTime = planSendTime;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
	public int getError_code() {
		return error_code;
	}

	public void setError_code(int error_code) {
		this.error_code = error_code;
	}

}


